from django.shortcuts import render
from django.http import JsonResponse


def data_list(request):
    return render(request, 'data_list.html')


def data_char(request):
    series_data = [{
        "name": '销量',
        "type": 'bar',
        "data": [5, 20, 36, 10, 10, 20]
    },{
            "name": '用户',
            "type": 'bar',
            "data": [43, 10, 16, 30, 20, 10]
        }]

    xAxis_data = ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']

    legend_data = ['销量', '用户']

    result  = {
        "status":True,
        "data":{
            "series_data": series_data,
            "xAxis_data": xAxis_data,
            "legend_data": legend_data
        }
    }
    return JsonResponse(result)